package com.zhaopin.proxy;

public class StaticAgency {
    static interface MyInterface{
        void test();
    }

    static class MyInterfaceImpl implements MyInterface{

        @Override
        public void test() {
            System.out.println("the real method !");
        }
    }

   static class MyProxy{

        private MyInterface myInterface;

        public MyProxy(MyInterface myInterface) {
            this.myInterface = myInterface;
        }

        public void test(){
            System.out.println("before method");
            myInterface.test();
            System.out.println("after method");
        }

    }



}


class Bootstrap{
    public static void main(String[] args) {
        StaticAgency.MyInterface myInterface = new StaticAgency.MyInterfaceImpl();
        StaticAgency.MyProxy myProxy = new StaticAgency.MyProxy(myInterface);
        myProxy.test();

    }
}